app.controller('baseController',function($scope){
	//修改，添加窗口
	$scope.saveForm = function(id) {
		if(id!=null){
			$scope.getBlogTypeById(id);//根据id获取实体，回显
		}
		$scope.entity={};//清空实体
		layui.use('layer', function() {
			var layer = layui.layer;
			layer.open({
				type:1,
				title:id==null?"添加":"修改",
				content:$("#myForm"),
				area: ['500px', '300px']
			});
		});
	}
	//选中id是个集合，批量删除
	$scope.selectIds = [];
	$scope.updateSelectOption = function($event,typeId){
		if($event.target.checked){
			$scope.selectIds.push(typeId);
		}else{
			var index = $scope.selectIds.indexOf(typeId);
			$scope.selectIds.splice(index,1);//删除
		}
	}
	/*$scope.searchEntity = {};
	$scope.reloadList = function(page,rows){
		alert("page="+page+"，rows="+rows);
		$scope.search(page,rows);
		alert($scope.total);
	}*/
	
/*	layui.use('laypage', function(){
		  var laypage = layui.laypage;
		  //执行一个laypage实例
		  laypage.render({
		    elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
		    ,count: 9//数据总数，从服务端得到
		    ,limit: 3
		    ,jump:function(obj,first){
		    	$scope.reloadList(obj.curr,obj.limit);
		    }
		  });	
		});*/
	
	
	
});